<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-xs-12">
		<div class="btn-group m-b-1" role="group">
			<?php echo admin_tab_active($menu['transfer']['tab'], 'hand');?>
		</div>
	</div>
</div>

<div class="row">
	<div class="col-lg-12">
		<div class="card">
			<div class="table-responsive">
					<table class="table" style="min-width: 800px">
						<thead>
							<tr>
								<th class="text-center">通道名称</th>
								<th class="text-center">实时剩余金额</th>
								<th class="text-center">支付宝转账账号</th>
								<th class="text-center" colspan="2">转账</th>
							</tr>
						</thead>
						<tbody id="userlist">
							<?php if($channel){foreach($channel as $l){ ?>
							<form action="<?php echo url('transfer-hand');?>" method="POST" id="form<?php echo $l['id'];?>">
							<tr uid="<?php echo $l['id']; ?>">
								<td class="text-center"><?php echo $l['name'];?></td>
								<td class="text-center"><?php echo $l['money'];?></td>
								<td class="text-center"><?php echo $l['transto']; ?></td>
								<td class="text-center" width="100"><input class="form-control" name="amount" value="" style="width:100px; " placeholder="转账金额"></td>
								<td class="text-center" width="80"><button class="btn btn-primary" name="form<?php echo $l['id'];?>">转账</butotn></td>
                  			</tr>
							<input type="hidden" name="chid" value="<?php echo $l['id']; ?>">
							<input type="hidden" name="channel" value="<?php echo $l['name']; ?>">
							<input type="hidden" name="gate_id" value="<?php echo $l['gate_id']; ?>">
							<input type="hidden" name="transto" value="<?php echo $l['transto']; ?>">
							</form>
							<?php }} ?>
						</tbody>
					</table>
			</div>
			<hr class="m-t-0" />
		</div>
		<nav class="text-center"><ul class="pagination"><?php echo $pagination; ?></ul></nav>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
$(document).ready(function () {
	$('button').click(function(){
		var jformid=$(this).attr('name');
		var jform = $('#'+jformid);
		var postdata = jform.serialize();
		$.xpost(jform.attr('action'), postdata, function(code, message){
			$.alert(message);
			if(code==1) setTimeout(function(){window.location.reload()}, 1500);
		});
		return false;
	});

	$('#nav_pc li.transfer, #nav_mobile li.transfer').tab('show');
});
</script>